function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
% function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
%
% File created by Dynare Preprocessor from .mod file
%
% Inputs:
%   T             [#temp variables by 1]     double   vector of temporary terms to be filled by function
%   y             [#dynamic variables by 1]  double   vector of endogenous variables in the order stored
%                                                     in M_.lead_lag_incidence; see the Manual
%   x             [nperiods by M_.exo_nbr]   double   matrix of exogenous variables (in declaration order)
%                                                     for all simulation periods
%   steady_state  [M_.endo_nbr by 1]         double   vector of steady state values
%   params        [M_.param_nbr by 1]        double   vector of parameter values in declaration order
%   it_           scalar                     double   time period for exogenous variables for which
%                                                     to evaluate the model
%   T_flag        boolean                    boolean  flag saying whether or not to calculate temporary terms
%
% Output:
%   g1
%

if T_flag
    T = model_file.dynamic_g1_tt(T, y, x, params, steady_state, it_);
end
g1 = zeros(97, 170);
g1(1,23)=getPowerDeriv(y(23),T(2),1);
g1(1,24)=(-(params(1)*getPowerDeriv(y(24),T(2),1)));
g1(2,120)=(-(exp(y(127))*T(46)));
g1(2,24)=getPowerDeriv(y(24),1-params(3),1);
g1(2,127)=(-(y(120)*exp(y(127))*T(46)));
g1(3,23)=(-(T(6)*T(44)*T(45)));
g1(3,1)=(-(T(6)*T(45)*T(47)));
g1(3,27)=1;
g1(3,53)=(-(T(9)*T(80)));
g1(3,54)=(-(T(9)*T(81)+T(6)*T(7)*T(45)));
g1(4,29)=getPowerDeriv(y(29),T(10),1);
g1(4,30)=(-(params(9)*getPowerDeriv(y(30),T(10),1)));
g1(4,49)=(-(T(11)*(1-params(9))*T(10)*exp(T(10)*y(49))));
g1(4,50)=(-((1-params(9))*exp(T(10)*y(49))*T(78)));
g1(5,25)=1;
g1(5,27)=(-(y(9)/y(39)));
g1(5,9)=(-(y(27)/y(39)));
g1(5,39)=(-((-(y(27)*y(9)))/(y(39)*y(39))));
g1(6,29)=(-(params(5)*T(50)*T(51)));
g1(6,34)=(-(params(5)*T(51)*T(64)));
g1(6,36)=1/y(39);
g1(6,39)=(-y(36))/(y(39)*y(39));
g1(7,28)=1;
g1(7,7)=(-(T(15)*T(14)*T(59)));
g1(7,34)=(-(T(15)*T(13)*T(65)));
g1(7,46)=(-(T(13)*T(14)*(1-params(12))*T(15)));
g1(8,28)=T(1);
g1(8,30)=1;
g1(8,32)=1;
g1(8,68)=1;
g1(9,7)=(-(1-params(13)+y(62)));
g1(9,33)=exp(y(47));
g1(9,47)=y(33)*exp(y(47));
g1(9,62)=(-y(7));
g1(10,32)=(-(T(17)*T(56)*T(57)));
g1(10,7)=(-(T(17)*T(57)*T(60)));
g1(10,62)=1;
g1(11,32)=(-(T(19)*y(45)*(-(y(63)/y(7)))));
g1(11,7)=(-(T(19)*T(62)));
g1(11,35)=exp(y(35));
g1(11,44)=(-(T(19)*(-y(66))));
g1(11,11)=(-(T(21)*T(76)));
g1(11,45)=(-(T(19)*T(20)));
g1(11,62)=(-(T(19)*y(45)));
g1(11,63)=(-(T(19)*y(45)*(-T(18))));
g1(11,64)=(-T(19));
g1(11,66)=(-(T(19)*(-y(44))));
g1(12,28)=(-(params(12)*(1-1/params(11))/y(7)));
g1(12,7)=(-(T(63)/(y(7)*y(7))));
g1(12,64)=1;
g1(13,7)=(-(T(22)/(y(7)*y(7))));
g1(13,66)=1;
g1(14,32)=(-(params(18)*T(56)*T(58)));
g1(14,7)=(-(params(18)*T(58)*T(60)));
g1(14,63)=1;
g1(15,121)=exp(y(122));
g1(15,122)=y(121)*exp(y(122));
g1(16,45)=y(63);
g1(16,63)=y(45);
g1(17,36)=T(1);
g1(17,44)=(-y(67));
g1(17,65)=1;
g1(17,67)=(-y(44));
g1(18,28)=(-(T(24)/y(34)));
g1(18,34)=(-((-(y(28)*T(24)))/(y(34)*y(34))));
g1(18,65)=1;
g1(19,34)=(-(T(25)/(y(34)*y(34))));
g1(19,67)=1;
g1(20,121)=(-(exp(y(47))*y(129)));
g1(20,44)=1;
g1(20,47)=(-(exp(y(47))*y(121)*y(129)));
g1(20,69)=T(1);
g1(20,129)=(-(exp(y(47))*y(121)));
g1(21,28)=(-T(27));
g1(21,37)=(-(y(28)*T(67)));
g1(21,68)=1;
g1(22,28)=(-(exp(y(37)-params(44))*params(14)*(exp(y(37)-params(44))-1)));
g1(22,37)=(-(y(28)*T(68)));
g1(22,69)=1;
g1(23,28)=(-(exp(y(37)-params(44))*(exp(y(37)-params(44))-1)*(-params(14))));
g1(23,37)=(-(y(28)*T(69)));
g1(23,70)=1;
g1(24,121)=exp(y(38))*T(48);
g1(24,123)=exp(y(38))*T(72);
g1(24,38)=T(28)*exp(y(38));
g1(25,28)=(-((1-params(40))*params(42)*T(49)/T(29)));
g1(25,37)=(-((1-params(40))*params(41)));
g1(25,8)=(-params(40));
g1(25,38)=1;
g1(25,166)=(-params(43));
g1(26,121)=exp(y(126)-y(123))*exp(y(71));
g1(26,123)=T(73);
g1(26,126)=T(30);
g1(26,71)=T(30);
g1(27,30)=(-(T(33)*T(54)*T(55)));
g1(27,40)=1;
g1(27,49)=(-(T(35)*T(77)));
g1(27,50)=(-(T(33)*T(55)*T(79)));
g1(28,29)=y(39);
g1(28,30)=T(1);
g1(28,39)=y(29);
g1(28,40)=(-y(50));
g1(28,50)=(-y(40));
g1(29,37)=T(1);
g1(29,10)=1/y(10);
g1(29,40)=(-(1/y(40)));
g1(29,42)=1;
g1(30,37)=T(1);
g1(30,9)=1/y(9);
g1(30,39)=(-(1/y(39)));
g1(30,41)=1;
g1(31,37)=T(70);
g1(31,10)=T(74);
g1(31,40)=T(75);
g1(31,43)=exp(y(43));
g1(32,40)=1/y(40);
g1(32,125)=(-(1/y(125)));
g1(32,51)=1;
g1(33,12)=(-params(24));
g1(33,46)=1;
g1(33,14)=(-(params(23)*params(27)*exp(y(14))*x(it_, 1)));
g1(33,165)=(-(params(23)*params(27)*exp(y(14))));
g1(34,13)=(-params(16));
g1(34,47)=1;
g1(34,14)=(-(x(it_, 1)*exp(y(14))*params(27)*params(17)));
g1(34,165)=(-(exp(y(14))*params(27)*params(17)));
g1(35,16)=(-(params(35)*1/y(16)));
g1(35,50)=T(54);
g1(35,167)=(-T(36));
g1(36,15)=T(1);
g1(36,52)=1;
g1(37,15)=(-params(36));
g1(37,49)=1;
g1(37,17)=(-params(37));
g1(37,165)=(-params(38));
g1(37,168)=(-params(34));
g1(38,14)=(-params(26));
g1(38,48)=1;
g1(38,165)=params(27)*params(30);
g1(38,170)=(-params(28));
g1(39,28)=T(1);
g1(39,32)=1;
g1(39,34)=y(36);
g1(39,36)=y(34);
g1(39,68)=1;
g1(39,72)=1;
g1(40,40)=(-(y(50)*params(39)));
g1(40,50)=(-(y(40)*params(39)));
g1(40,72)=T(1);
g1(40,73)=1;
g1(41,13)=T(1);
g1(41,19)=1/y(19);
g1(41,72)=(-(1/y(72)));
g1(41,74)=1;
g1(42,37)=T(1);
g1(42,43)=1;
g1(42,74)=T(1);
g1(42,76)=1;
g1(43,43)=T(1);
g1(43,75)=1;
g1(43,76)=T(1);
g1(44,13)=T(1);
g1(44,20)=1/y(20);
g1(44,73)=(-(1/y(73)));
g1(44,77)=1;
g1(45,37)=T(1);
g1(45,43)=1;
g1(45,77)=T(1);
g1(45,79)=1;
g1(46,43)=T(1);
g1(46,78)=1;
g1(46,79)=T(1);
g1(47,121)=(-((1+exp(y(134)))*exp(y(130))));
g1(47,130)=(-(y(121)*(1+exp(y(134)))*exp(y(130))));
g1(47,80)=exp(y(80));
g1(47,134)=(-(exp(y(130))*y(121)*exp(y(134))));
g1(48,74)=T(83);
g1(48,21)=T(89);
g1(48,80)=T(91);
g1(48,82)=exp(y(82));
g1(49,76)=T(84);
g1(49,21)=T(90);
g1(49,80)=T(92);
g1(49,83)=exp(y(83));
g1(50,121)=(-((1+exp(y(135)))*exp(y(131))));
g1(50,131)=(-(y(121)*(1+exp(y(135)))*exp(y(131))));
g1(50,81)=exp(y(81));
g1(50,135)=(-(exp(y(131))*y(121)*exp(y(135))));
g1(51,77)=T(85);
g1(51,22)=T(94);
g1(51,81)=T(97);
g1(51,84)=exp(y(84));
g1(52,79)=T(87);
g1(52,22)=T(95);
g1(52,81)=T(98);
g1(52,86)=exp(y(86));
g1(53,78)=T(86);
g1(53,22)=T(96);
g1(53,81)=T(99);
g1(53,85)=exp(y(85));
g1(54,18)=(-(T(82)/T(37)));
g1(54,83)=(-(exp(y(83))*params(20)/T(37)));
g1(54,87)=1;
g1(54,169)=(-params(32));
g1(55,18)=(-(T(82)/T(38)));
g1(55,86)=(-(exp(y(86))*params(20)/T(38)));
g1(55,116)=1;
g1(55,169)=(-params(32));
g1(56,71)=1;
g1(56,139)=T(1);
g1(56,88)=1;
g1(57,71)=1;
g1(57,164)=T(1);
g1(57,117)=1;
g1(58,121)=(-(1/y(121)));
g1(58,26)=1;
g1(59,121)=y(109)*T(48)-y(125);
g1(59,123)=y(109)*T(72);
g1(59,125)=(-y(121));
g1(59,109)=T(28);
g1(60,121)=(-(exp((-y(124)))*T(48)));
g1(60,123)=(-(exp((-y(124)))*T(72)));
g1(60,124)=(-(T(28)*(-exp((-y(124))))));
g1(60,89)=(-2)*exp((-2)*y(89));
g1(61,121)=(-(exp((-2)*y(140))*T(48)));
g1(61,123)=(-(exp((-2)*y(140))*T(72)));
g1(61,140)=(-(T(28)*(-2)*exp((-2)*y(140))));
g1(61,90)=(-3)*exp((-3)*y(90));
g1(62,121)=(-(exp((-3)*y(141))*T(48)));
g1(62,123)=(-(exp((-3)*y(141))*T(72)));
g1(62,141)=(-(T(28)*(-3)*exp((-3)*y(141))));
g1(62,91)=(-4)*exp((-4)*y(91));
g1(63,121)=(-(exp((-4)*y(142))*T(48)));
g1(63,123)=(-(exp((-4)*y(142))*T(72)));
g1(63,142)=(-(T(28)*(-4)*exp((-4)*y(142))));
g1(63,92)=(-5)*exp((-5)*y(92));
g1(64,121)=(-(exp((-5)*y(143))*T(48)));
g1(64,123)=(-(exp((-5)*y(143))*T(72)));
g1(64,143)=(-(T(28)*(-5)*exp((-5)*y(143))));
g1(64,93)=(-6)*exp((-6)*y(93));
g1(65,121)=(-(exp((-6)*y(144))*T(48)));
g1(65,123)=(-(exp((-6)*y(144))*T(72)));
g1(65,144)=(-(T(28)*(-6)*exp((-6)*y(144))));
g1(65,94)=(-7)*exp((-7)*y(94));
g1(66,121)=(-(exp((-7)*y(145))*T(48)));
g1(66,123)=(-(exp((-7)*y(145))*T(72)));
g1(66,145)=(-(T(28)*(-7)*exp((-7)*y(145))));
g1(66,95)=(-8)*exp((-8)*y(95));
g1(67,121)=(-(exp((-8)*y(146))*T(48)));
g1(67,123)=(-(exp((-8)*y(146))*T(72)));
g1(67,146)=(-(T(28)*(-8)*exp((-8)*y(146))));
g1(67,96)=(-9)*exp((-9)*y(96));
g1(68,121)=(-(exp((-9)*y(147))*T(48)));
g1(68,123)=(-(exp((-9)*y(147))*T(72)));
g1(68,147)=(-(T(28)*(-9)*exp((-9)*y(147))));
g1(68,97)=(-10)*exp((-10)*y(97));
g1(69,121)=(-(exp((-10)*y(148))*T(48)));
g1(69,123)=(-(exp((-10)*y(148))*T(72)));
g1(69,148)=(-(T(28)*(-10)*exp((-10)*y(148))));
g1(69,98)=(-11)*exp((-11)*y(98));
g1(70,121)=(-(exp((-11)*y(149))*T(48)));
g1(70,123)=(-(exp((-11)*y(149))*T(72)));
g1(70,149)=(-(T(28)*(-11)*exp((-11)*y(149))));
g1(70,99)=(-12)*exp((-12)*y(99));
g1(71,121)=(-(exp((-12)*y(150))*T(48)));
g1(71,123)=(-(exp((-12)*y(150))*T(72)));
g1(71,150)=(-(T(28)*(-12)*exp((-12)*y(150))));
g1(71,100)=(-13)*exp((-13)*y(100));
g1(72,121)=(-(exp((-13)*y(151))*T(48)));
g1(72,123)=(-(exp((-13)*y(151))*T(72)));
g1(72,151)=(-(T(28)*(-13)*exp((-13)*y(151))));
g1(72,101)=(-14)*exp((-14)*y(101));
g1(73,121)=(-(exp((-14)*y(152))*T(48)));
g1(73,123)=(-(exp((-14)*y(152))*T(72)));
g1(73,152)=(-(T(28)*(-14)*exp((-14)*y(152))));
g1(73,102)=(-15)*exp((-15)*y(102));
g1(74,121)=(-(exp((-15)*y(153))*T(48)));
g1(74,123)=(-(exp((-15)*y(153))*T(72)));
g1(74,153)=(-(T(28)*(-15)*exp((-15)*y(153))));
g1(74,103)=(-16)*exp((-16)*y(103));
g1(75,121)=(-(exp((-16)*y(154))*T(48)));
g1(75,123)=(-(exp((-16)*y(154))*T(72)));
g1(75,154)=(-(T(28)*(-16)*exp((-16)*y(154))));
g1(75,104)=(-17)*exp((-17)*y(104));
g1(76,121)=(-(exp((-17)*y(155))*T(48)));
g1(76,123)=(-(exp((-17)*y(155))*T(72)));
g1(76,155)=(-(T(28)*(-17)*exp((-17)*y(155))));
g1(76,105)=(-18)*exp((-18)*y(105));
g1(77,121)=(-(exp((-18)*y(156))*T(48)));
g1(77,123)=(-(exp((-18)*y(156))*T(72)));
g1(77,156)=(-(T(28)*(-18)*exp((-18)*y(156))));
g1(77,106)=(-19)*exp((-19)*y(106));
g1(78,121)=(-(exp((-19)*y(157))*T(48)));
g1(78,123)=(-(exp((-19)*y(157))*T(72)));
g1(78,157)=(-(T(28)*(-19)*exp((-19)*y(157))));
g1(78,107)=(-20)*exp((-20)*y(107));
g1(79,38)=1;
g1(79,107)=T(1);
g1(79,108)=1;
g1(80,3)=1/y(3);
g1(80,29)=(-(1/y(29)));
g1(80,13)=T(1);
g1(80,53)=1;
g1(81,4)=1/y(4);
g1(81,30)=(-(1/y(30)));
g1(81,13)=T(1);
g1(81,55)=1;
g1(82,13)=T(1);
g1(82,16)=1/y(16);
g1(82,50)=(-T(54));
g1(82,56)=1;
g1(83,12)=1;
g1(83,46)=T(1);
g1(83,13)=T(1);
g1(83,58)=1;
g1(84,128)=T(1);
g1(84,59)=1;
g1(85,29)=(-(T(52)*T(53)));
g1(85,31)=1;
g1(85,34)=(-(T(53)*T(66)));
g1(86,5)=1/y(5);
g1(86,31)=(-(1/y(31)));
g1(86,13)=T(1);
g1(86,54)=1;
g1(87,41)=T(1);
g1(87,43)=1;
g1(87,53)=T(1);
g1(87,57)=1;
g1(88,2)=1/(y(2)+y(10)*y(16));
g1(88,28)=(-(1/(y(28)+y(50)*y(40))));
g1(88,37)=T(1);
g1(88,10)=y(16)/(y(2)+y(10)*y(16));
g1(88,40)=(-(y(50)/(y(28)+y(50)*y(40))));
g1(88,43)=1;
g1(88,13)=T(1);
g1(88,16)=y(10)/(y(2)+y(10)*y(16));
g1(88,50)=(-(y(40)/(y(28)+y(50)*y(40))));
g1(88,60)=1;
g1(89,6)=1/y(6);
g1(89,32)=(-(1/y(32)));
g1(89,37)=T(1);
g1(89,43)=1;
g1(89,13)=T(1);
g1(89,61)=1;
g1(90,133)=T(1);
g1(90,110)=1;
g1(90,158)=(-params(21));
g1(91,136)=T(1);
g1(91,111)=1;
g1(91,159)=(-params(21));
g1(92,132)=T(1);
g1(92,112)=1;
g1(92,160)=(-params(21));
g1(93,137)=T(1);
g1(93,113)=1;
g1(93,161)=(-params(21));
g1(94,71)=T(1);
g1(94,114)=1;
g1(94,162)=(-params(21));
g1(95,38)=T(1);
g1(95,115)=1;
g1(95,163)=(-params(21));
g1(96,138)=T(1);
g1(96,118)=1;
g1(97,137)=T(1);
g1(97,119)=1;

end
